GS Fisheries’ share
of total exports
# Import
IEXSITC_raw <-
statgl_url("IEXSITC", lang = language) %>%
statgl_fetch(quarter = 0,
processing = c("G11", "3"),
transaction = 2,
time = px_all(),
.col_code = TRUE
) %>%
as_tibble()
# Transform
step <-
IEXSITC_raw %>%
mutate(processing = processing %>% str_remove_all("[:digit:]|\\-") %>% trimws(which = "left")) %>%
arrange(time, processing)
IEXSITC <-
step %>%
mutate(export = fct_reorder(processing, -value, sum, na.rm = TRUE),
time = make_date(time),
value = value / 10^9)
# Plot
IEXSITC %>%
ggplot(aes(
x = time,
y = value,
fill = export
)) +
geom_area(position = "identity") +
theme_statgl() +
scale_fill_statgl(reverse = TRUE) +
labs(
title = sdg9$figs$fig4$title[language],
y = sdg9$figs$fig4$y_lab[language],
x = " ",
fill = " ",
caption = sdg9$figs$fig4$cap[language]
)
StatBank Method
# Import
IEXSITC_raw <-
statgl_url("IEXSITC", lang = language) %>%
statgl_fetch(processing = px_all(),
transaction = 2,
time = px_all(),
.col_code = TRUE
) %>%
as_tibble()
# Transform
IEXSITC <-
IEXSITC_raw %>%
filter(processing %in% unique(IEXSITC_raw[[1]])[c(16, 26, 45, 55, 65, 74)]) %>%
mutate(
time = time %>% make_date(),
value = value / 10^6,
processing = processing %>% str_remove_all("[:digit:]|\\-") %>% trimws()
)
# Plot
IEXSITC %>%
ggplot(aes(
x = time,
y = value,
fill = processing
)) +
geom_area() +
facet_wrap(~ processing, labeller = label_wrap_gen(30)) +
scale_fill_statgl() +
theme_statgl() +
theme(plot.margin = margin(10, 10, 10, 10)) +
theme(legend.position = "none") +
labs(
title = sdg9$figs$fig5$title[language],
x = " ",
y = sdg9$figs$fig5$y_lab[language],
fill = " ",
caption = sdg9$figs$fig4$cap[language]
)
StatBank Method